# the minimum version of CMake.
cmake_minimum_required(VERSION 3.4.1)
project(mp4parser)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")

set(distribution_DIR ${CMAKE_SOURCE_DIR}/../../../libs/${OHOS_ARCH})

add_library(mp4parser_napi SHARED
           log/ohos_log.cpp
           ffmpeg_thread/ffmpeg_thread.c
           ffmpeg/cmdutils.c
           ffmpeg/ffmpeg.c
           ffmpeg/ffmpeg_filter.c
           ffmpeg/ffmpeg_opt.c
           ffmpeg/custom_ffmpeg_log.c
           ffmpeg/ffmpeg_utils.c
           ffmpeg/ffmpeg_mediametadataretriever.c
           napi/mp4parser_napi.cpp
           )

add_library(ffmpeg
        SHARED
        IMPORTED )


set_target_properties( ffmpeg
        PROPERTIES IMPORTED_LOCATION
        ${distribution_DIR}/libohffmpeg.z.so)

include_directories(
        ${CMAKE_SOURCE_DIR}/include/library/src/main/cpp/include
        ${CMAKE_SOURCE_DIR}/ffmpeg
)

target_link_libraries(mp4parser_napi ffmpeg)
target_link_libraries(mp4parser_napi hilog_ndk.z)
target_link_libraries(mp4parser_napi ace_napi.z)
target_link_libraries(mp4parser_napi uv)